namespace Sckf.MicroService.Services.Catalog;

public class PaginatedResultViewModel<TEntity> where TEntity : class
{
    /// <summary>
    /// 页码
    /// </summary>
    public int PageIndex { get; set; }

    /// <summary>
    /// 每页记录数
    /// </summary>
    public int PageSize { get; set; }

    /// <summary>
    /// 总记录数
    /// </summary>
    public long TotalCount { get; set; }

    /// <summary>
    /// 结果
    /// </summary>
    /// <value></value>
    public IEnumerable<TEntity> Items { get; private set; }

    public PaginatedResultViewModel(int pageIndex, int pageSize, long totalCount, IEnumerable<TEntity> items)
    {
        PageIndex = pageIndex;
        PageSize = pageSize;
        TotalCount = totalCount;
        Items = items;
    }
}